home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM BV3 / BMUG PD-ROM Version BV3 (CDRM1097900).iso / HyperCard / XCMDs⁄XFCN / HierPopUp 2.7.1 / HierPopUp 2.7.1 / cards.xml < prev    next >
Text File  |  1991-09-29  |  47KB  |  914 lines

  1. card_3475.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>3475</id>
  6.     <filler1>0</filler1>
  7.     <bitmap>BMAP_5676.pbm</bitmap>
  8.     <cantDelete> <false /> </cantDelete>
  9.     <showPict> <true /> </showPict>
  10.     <dontSearch> <false /> </dontSearch>
  11.     <owner>3736</owner>
  12.     <link rel="stylesheet" type="text/css" href="stylesheet_2245.css" />
  13.     <part>
  14.         <id>1</id>
  15.         <type>button</type>
  16.         <visible> <true /> </visible>
  17.         <reserved5> 0 </reserved5>
  18.         <reserved4> 0 </reserved4>
  19.         <reserved3> 0 </reserved3>
  20.         <reserved2> 0 </reserved2>
  21.         <reserved1> 0 </reserved1>
  22.         <enabled> <true /> </enabled>
  23.         <rect>
  24.             <left>203</left>
  25.             <top>214</top>
  26.             <right>285</right>
  27.             <bottom>236</bottom>
  28.         </rect>
  29.         <style>roundrect</style>
  30.         <showName> <true /> </showName>
  31.         <highlight> <false /> </highlight>
  32.         <autoHighlight> <false /> </autoHighlight>
  33.         <sharedHighlight> <true /> </sharedHighlight>
  34.         <family>0</family>
  35.         <titleWidth>0</titleWidth>
  36.         <icon>0</icon>
  37.         <textAlign>center</textAlign>
  38.         <font>Chicago</font>
  39.         <textSize>12</textSize>
  40.         <textStyle>plain</textStyle>
  41.         <name>Write File</name>
  42.         <script>on mouseUpif the optionKey is up thenask file "Save as‚Ķ" with "HPopup.p"if it is empty then exit mouseUpput it into lastFileNameopen file lastFileNamewrite card field "Code" to file lastFileNameclose file lastFileNameelseanswer file "Where is the source?" of type "TEXT"if it is empty then exit mouseUpput it into fileNameopen file fileNameread from file fileName until eofput it into cd fld "Code"close file fileNameend ifend mouseUp</script>
  43.     </part>
  44.     <part>
  45.         <id>4</id>
  46.         <type>button</type>
  47.         <visible> <true /> </visible>
  48.         <reserved5> 0 </reserved5>
  49.         <reserved4> 0 </reserved4>
  50.         <reserved3> 0 </reserved3>
  51.         <reserved2> 0 </reserved2>
  52.         <reserved1> 0 </reserved1>
  53.         <enabled> <true /> </enabled>
  54.         <rect>
  55.             <left>466</left>
  56.             <top>264</top>
  57.             <right>512</right>
  58.             <bottom>342</bottom>
  59.         </rect>
  60.         <style>transparent</style>
  61.         <showName> <false /> </showName>
  62.         <highlight> <true /> </highlight>
  63.         <autoHighlight> <false /> </autoHighlight>
  64.         <sharedHighlight> <true /> </sharedHighlight>
  65.         <family>0</family>
  66.         <titleWidth>0</titleWidth>
  67.         <icon>11045</icon>
  68.         <textAlign>center</textAlign>
  69.         <font>Chicago</font>
  70.         <textSize>12</textSize>
  71.         <textStyle>plain</textStyle>
  72.         <name>Home</name>
  73.         <script>on mouseUpvisual scroll upgo homeend mouseUp</script>
  74.     </part>
  75.     <part>
  76.         <id>5</id>
  77.         <type>button</type>
  78.         <visible> <true /> </visible>
  79.         <reserved5> 0 </reserved5>
  80.         <reserved4> 0 </reserved4>
  81.         <reserved3> 0 </reserved3>
  82.         <reserved2> 0 </reserved2>
  83.         <reserved1> 0 </reserved1>
  84.         <enabled> <true /> </enabled>
  85.         <rect>
  86.             <left>297</left>
  87.             <top>214</top>
  88.             <right>379</right>
  89.             <bottom>236</bottom>
  90.         </rect>
  91.         <style>roundrect</style>
  92.         <showName> <true /> </showName>
  93.         <highlight> <false /> </highlight>
  94.         <autoHighlight> <false /> </autoHighlight>
  95.         <sharedHighlight> <true /> </sharedHighlight>
  96.         <family>0</family>
  97.         <titleWidth>0</titleWidth>
  98.         <icon>0</icon>
  99.         <textAlign>center</textAlign>
  100.         <font>Chicago</font>
  101.         <textSize>12</textSize>
  102.         <textStyle>plain</textStyle>
  103.         <name>Show Code</name>
  104.         <script>on mouseUplock screenif visible of card field "Code" then hide card field "Code"else show card field "Code"unlock screen with dissolveend mouseUp</script>
  105.     </part>
  106.     <part>
  107.         <id>6</id>
  108.         <type>button</type>
  109.         <visible> <true /> </visible>
  110.         <reserved5> 0 </reserved5>
  111.         <reserved4> 0 </reserved4>
  112.         <reserved3> 0 </reserved3>
  113.         <reserved2> 0 </reserved2>
  114.         <reserved1> 0 </reserved1>
  115.         <enabled> <true /> </enabled>
  116.         <rect>
  117.             <left>197</left>
  118.             <top>251</top>
  119.             <right>384</right>
  120.             <bottom>273</bottom>
  121.         </rect>
  122.         <style>roundrect</style>
  123.         <showName> <true /> </showName>
  124.         <highlight> <false /> </highlight>
  125.         <autoHighlight> <true /> </autoHighlight>
  126.         <sharedHighlight> <true /> </sharedHighlight>
  127.         <family>0</family>
  128.         <titleWidth>0</titleWidth>
  129.         <icon>0</icon>
  130.         <textAlign>center</textAlign>
  131.         <font>Chicago</font>
  132.         <textSize>12</textSize>
  133.         <textStyle>plain</textStyle>
  134.         <name>Install HPopUpMenu</name>
  135.         <script>on mouseUpput "Pick a stack to install HPopUpMenu into."put FileName( "STAK" ) into theTargetif theTarget is empty thenbeep 1answer "Installation cancelled." with "Ok"elseset cursor to watchget second word of the long name of stackput it into theSourceResCopy value of theSource, theTarget, "XFCN", "HPopUpMenu"if "OK" is in the result then answer "Installation complete." with "Ok"else error "HPopUpMenu"end ifhide msgend mouseUpon error whatbeepanswer "Unable to install " & what & "."  with "Cancel"end error</script>
  136.     </part>
  137.     <part>
  138.         <id>2</id>
  139.         <type>field</type>
  140.         <visible> <false /> </visible>
  141.         <dontWrap> <false /> </dontWrap>
  142.         <dontSearch> <false /> </dontSearch>
  143.         <sharedText> <false /> </sharedText>
  144.         <fixedLineHeight> <true /> </fixedLineHeight>
  145.         <autoTab> <false /> </autoTab>
  146.         <lockText> <true /> </lockText>
  147.         <rect>
  148.             <left>0</left>
  149.             <top>0</top>
  150.             <right>512</right>
  151.             <bottom>342</bottom>
  152.         </rect>
  153.         <style>scrolling</style>
  154.         <autoSelect> <false /> </autoSelect>
  155.         <showLines> <false /> </showLines>
  156.         <wideMargins> <false /> </wideMargins>
  157.         <multipleLines> <false /> </multipleLines>
  158.         <reservedFamily> 0 </reservedFamily>
  159.         <titleWidth>0</titleWidth>
  160.         <icon>0</icon>
  161.         <textAlign>left</textAlign>
  162.         <font>Monaco</font>
  163.         <textSize>9</textSize>
  164.         <textStyle>plain</textStyle>
  165.         <textHeight>12</textHeight>
  166.         <name>Code</name>
  167.         <script>on mouseUplock screenhide card field "Code"set scroll of target to 0unlock screen with dissolveend mouseUp</script>
  168.     </part>
  169.     <content>
  170.         <layer>background</layer>
  171.         <id>3</id>
  172.         <text>Some of the features I worked hard to include are the ability to select the items on the main menu and to correspondingly not select disabled items.I also went to some trouble to allow long strings so that you can have large menus. I also added the ability to use small icons. Please let me know if you find anything that doesn't work as it should.In the spirit of cooperation and the spread of knowledge, I have included the source code to this XFCN.  Simply press the magic button to get the file written to disk.</text>
  173.     </content>
  174.     <content>
  175.         <layer>card</layer>
  176.         <id>2</id>
  177.         <text>{$R-}{$S HPopUpMenu }(*This source code ¬© 1989, 1990, 1991 by Jon Pughjpugh@apple.com(415) 373-7872(408) 862-7094HPopUpMenu( MenuItems, CheckedItem, Top, Left );This HyperCard external function returns the selection from a HierarchicalPopUp menu created from a hypercard item list (the first parameter).  Thesecond parameter is the item to be checked.  Pass a negative number to avoidchecking anything and still place that item as the default.The menu is placed on the screen so that the checked item is at the position top,left.    The menu syntax is that comma seperates hierarchicalitems and semicolon or return seperates regular menu items except when there are nohierarchical menus you may use all commas, semicolons, or returns.i.e.item1,1,2,3;item2;item3,4,5,6is a menu where the format is:item1    1        2        3item2item3    4        5        6All the standard menu metacharacters work, in addition to the new ‚Ć metacharacterwhich is option-t. This works just like the icon metacharacter ^ except that instead of using an ICON resource, it uses an SICN resource.To compile and link using MPW executethe following:save -apascal -w HPopUp.plink -o HierPopUp -rt XFCN=3498 ‚àÇ    -m ENTRYPOINT -sn Main=HPopUpMenu -sg Main=PASLIB HPopUp.p.o ‚àÇ    "{PLibraries}"Paslib.o ‚àÇ    "{Libraries}"Interface.o ‚àÇ    "{Libraries}"HyperXLib.oI must thank Andrew Gilmartin FOR his initial example although I havecompletely rewritten anything that might have been from him originally.*)UNIT HPopUpUnit;INTERFACEUSES    MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf, HyperXCmd;PROCEDURE EntryPoint( paramPtr: XCmdPtr );IMPLEMENTATIONCONST    MenuDisableAddr     = $B54;    kSmallIconCmd        = $1E;TYPE    bigStringHandle     = ^bigStringPtr;    bigStringPtr        = ^bigString;    bigString            = packed array [1..maxInt] OF char;PROCEDURE HPopUpMenu( paramPtr: XCmdPtr ); FORWARD;PROCEDURE EntryPoint( paramPtr: XCmdPtr );BEGINHPopUpMenu( paramPtr )END;    { entrypoint }PROCEDURE HPopUpMenu( paramPtr: XCmdPtr );CONST    MenuID    = 128;VAR    pt    : Point;    p    : bigStringHandle;    pp    : bigStringPtr;    junk    : Ptr;    Menu    : Array [0..127] OF MenuHandle;    MenuDisable : ^LongInt;    scanning, enabled    : Boolean;    CheckedItem, SelectedItem    : LongInt;    MaxMenu, h, i, j, l, ItemCount, Len, Start, theIcon    : Integer;    MenuItems, AllItems    : Str255;    FUNCTION myNumToStr ( num : LongInt ) : Str255;    VAR        t : Str255;    BEGIN    NumToStr(ParamPtr, num, t);    myNumToStr := t;    END;    { myNumToStr }        FUNCTION ParamToNum( Param: Handle ): LongInt;    VAR        Str: Str255;    BEGIN    ZeroToPas( ParamPtr, Param^, Str );    ParamToNum := StrToNum( ParamPtr, Str );    END;    { ParamToNum }    FUNCTION NumToParam( Num: LongInt ): Handle;    VAR        Str: Str31;    BEGIN    Str := myNumToStr( Num );    NumToParam := PasToZero( ParamPtr, Str )    END;    { NumToParam }        FUNCTION myCopy (p : bigStringHandle; f, l : Integer) : Str255;    VAR        t : Str255;        i : Integer;    BEGIN    t := '';    FOR i := 1 TO l DO        BEGIN        t := Concat(t,' ');        t[i] := p^^[f+i-1];        END;    myCopy := t;    END;    { myCopy }        PROCEDURE OSErr (err : Integer);    VAR        t : Str255;    BEGIN    IF err <> noErr THEN        BEGIN        NumToString(err, t);        SendCardMessage(ParamPtr, Concat('Put "Error : ', t, '"'));        END;    END;    { OSErr }        FUNCTION SmallIcon( VAR menuText : Str255; VAR theIcon : Integer ) : Boolean;    VAR        l : LongInt;        i : Integer;        t : Str255;    BEGIN    { Check if the ‚Ć metacharacter is present }    { Remove it and everything after it }    { Return true only if this item doesn't already have a submenu }    i := Pos('‚Ć', menuText);    IF i = 0 THEN        SmallIcon := False    ELSE        BEGIN        t := Copy(menuText, i+1, length(menuText) - i);        Delete(menuText, i, 255);        l := 0;        StringToNum(t, l);        theIcon := LoWord(l);        SmallIcon := theIcon > 0;        IF t[length(t)-1] = '/' THEN            BEGIN            menuText := Concat(menuText, Copy(t, length(t)-1, 2));            SmallIcon := False;            END;        END;    END;    { SmallIcon }BEGINHLock(paramPtr^.Params[1]);WITH paramPtr^ DOIF paramPtr^.ParamCount < 4 THEN    returnValue := PasToZero(ParamPtr, 'Usage: HPopupMenu choices, item, h, v')ELSE IF not button or (StringLength(ParamPtr, Params[1]^) = 0) THEN    returnValue := PasToZero(ParamPtr, '')ELSE    BEGIN    { Make a copy of the input string that we can mess with }    p := bigStringHandle(Params[1]);    OsErr(HandToHand(Handle(p)));    len := StringLength(ParamPtr, Params[1]^);    { Check for all commas and convert them to ; if so }    scanning := true;    HLock(handle(p));    pp := p^;    FOR i := 1 TO len DO        BEGIN        IF pp^[i] = chr(13) THEN            pp^[i] := ';';        scanning := scanning and (pp^[i] <> ';');        END;    IF scanning THEN        FOR i := 1 TO len DO            IF pp^[i] = ',' THEN                pp^[i] := ';';    HUnlock(handle(p));    { Extend p by one character if we need to add a ; }    { Remember that we have a c format string }    SetHandleSize(Handle(p), GetHandleSize(Handle(p))+1);    OsErr(MemError);    HLock(handle(p));    pp := p^;    IF pp^[len] <> ';' THEN        BEGIN        len := len + 1;        { Move the zero back one character }        pp^[len+1] := pp^[len];        pp^[len] := ';';        END;    IF pp^[1] in [',',';'] THEN        start := 2    ELSE        start := 1;        CheckedItem := ParamToNum( Params[2] );    { Get Menu Position }    pt.v  := ParamToNum( Params[3] );    pt.h := ParamToNum( Params[4] );    localToGlobal(pt);    Menu[0] := NewMenu( MenuID, '' );    MaxMenu := 0;    { Create Main MenuItems }    pp := p^;    scanning := true;    j := start;    FOR i := start TO len DO        BEGIN        IF scanning THEN            IF pp^[i] in [',',';'] THEN                BEGIN                MenuItems := myCopy(p, j, i-j);                IF pp^[i] = ',' THEN                    BEGIN                    scanning := false;                    IF not (pp^[i+1] in [',',';']) THEN                        BEGIN                        MenuItems := Concat(MenuItems, '/-');                        MenuItems[Length(MenuItems)] := chr(hMenuCmd);                        END;                    END;                IF SmallIcon( MenuItems, theIcon ) THEN                    BEGIN                    AppendMenu( Menu[0], MenuItems );                    SetItemCmd( Menu[0], CountMItems(Menu[0]), chr(kSmallIconCmd) );                    SetItemIcon( Menu[0], CountMItems(Menu[0]), Ord(theIcon) );                    END                ELSE                    AppendMenu( Menu[0], MenuItems );                END;        IF pp^[i] = ';' THEN            BEGIN            j := i + 1;            scanning := true            END        END;    IF checkedItem > 0 THEN        CheckItem( Menu[0], CheckedItem, true );    InsertMenu( Menu[0], -1 );    { Create SubMenus }    ItemCount := 0;    scanning := true;    enabled := false;    j := 0;    FOR i := start TO len DO        BEGIN        IF pp^[i] in [';',','] THEN            BEGIN            IF scanning THEN                BEGIN                ItemCount := ItemCount + 1;                Menu[ItemCount] := nil;                IF pp^[i] = ',' THEN                    BEGIN                    { Add submenu to main menu }                    MaxMenu := MenuId+ItemCount;                    SetItemMark(Menu[0], ItemCount, Chr(MaxMenu));                    Menu[ItemCount] := NewMenu(MaxMenu, '');                    enabled := false;                    END;                END            ELSE                BEGIN                IF j <> i THEN                    BEGIN                    MenuItems := myCopy(p, j, i-j);                    IF SmallIcon( MenuItems, theIcon ) THEN                        BEGIN                        AppendMenu( Menu[ItemCount], MenuItems );                        SetItemCmd( Menu[ItemCount], CountMItems(Menu[ItemCount]), chr(kSmallIconCmd) );                        SetItemIcon( Menu[ItemCount], CountMItems(Menu[ItemCount]), Ord(theIcon) );                        END                    ELSE                        AppendMenu( Menu[ItemCount], MenuItems );                    enabled := true;                    END;                IF pp^[i] = ';' THEN                    IF enabled THEN                        InsertMenu(Menu[ItemCount], -1)                    ELSE                        BEGIN                        SetItemMark(Menu[0], ItemCount, chr(noMark));                        DeleteMenu(MaxMenu);                        DisposeMenu(Menu[ItemCount]);                        Menu[ItemCount] := nil;                        END;                END;            j := i + 1;            scanning := pp^[i] = ';';            END        END;    HUnlock(handle(p));    { Get Menu Selection }    IF button THEN        BEGIN        SelectedItem := PopUpMenuSelect( Menu[0], pt.v, pt.h, abs(CheckedItem) );        IF HiWord(SelectedItem) = 0 THEN            BEGIN            { Check for items that aren't returned }            MenuDisable := Pointer(MenuDisableAddr);            SelectedItem := MenuDisable^;            END;        END    ELSE        SelectedItem := 0;    h := HiWord(SelectedItem);    l := LoWord(SelectedItem);    { Convert numbers to words }    IF h = 0 THEN        BEGIN        AllItems := '';        MenuItems := '';        END    ELSE IF h = MenuID THEN        BEGIN        GetItem(Menu[0], l, AllItems);        MenuItems := '';        h := l + MenuID;        l := 0;        enabled := BTsT(Menu[0]^^.enableFlags, h-MenuID) OR (h-MenuID > 31);        END    ELSE        BEGIN        GetItem(Menu[0], h-MenuID, AllItems);        GetItem(Menu[h-MenuID], l, MenuItems);        enabled := BTsT(Menu[h-MenuID]^^.enableFlags, l) OR (l > 31);        END;    { Tidy up }    FOR i := 0 TO ItemCount DO        IF Menu[i] <> nil THEN            BEGIN            DeleteMenu( MenuID + i);            DisposeMenu( Menu[i] );            END;    DisposHandle(Handle(p));    { Return the words and numbers }    IF enabled and (AllItems <> '') THEN        returnValue := PasToZero(ParamPtr, Concat(AllItems, ',', MenuItems, ',',            myNumToStr(h-MenuID), ',', myNumToStr(l)))    ELSE        returnValue := PasToZero(ParamPtr, '');    END;HLock(paramPtr^.Params[1]);END;    { HPopUpMenu }END.    { HPopUp Unit }</text>
  178.     </content>
  179.     <name></name>
  180.     <script>on closeCardif visible of card field "Code" then hide card field "Code"pass closeCardend closeCard</script>
  181. </card>
  182.  
  183.  
  184. card_2792.xml
  185. <?xml version="1.0" encoding="utf-8" ?>
  186. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  187. <card>
  188.     <id>2792</id>
  189.     <filler1>0</filler1>
  190.     <bitmap>BMAP_3086.pbm</bitmap>
  191.     <cantDelete> <false /> </cantDelete>
  192.     <showPict> <true /> </showPict>
  193.     <dontSearch> <false /> </dontSearch>
  194.     <owner>3736</owner>
  195.     <link rel="stylesheet" type="text/css" href="stylesheet_2245.css" />
  196.     <part>
  197.         <id>1</id>
  198.         <type>button</type>
  199.         <visible> <true /> </visible>
  200.         <reserved5> 0 </reserved5>
  201.         <reserved4> 0 </reserved4>
  202.         <reserved3> 0 </reserved3>
  203.         <reserved2> 0 </reserved2>
  204.         <reserved1> 0 </reserved1>
  205.         <enabled> <true /> </enabled>
  206.         <rect>
  207.             <left>239</left>
  208.             <top>78</top>
  209.             <right>333</right>
  210.             <bottom>98</bottom>
  211.         </rect>
  212.         <style>opaque</style>
  213.         <showName> <true /> </showName>
  214.         <highlight> <false /> </highlight>
  215.         <autoHighlight> <false /> </autoHighlight>
  216.         <sharedHighlight> <true /> </sharedHighlight>
  217.         <family>0</family>
  218.         <titleWidth>0</titleWidth>
  219.         <icon>0</icon>
  220.         <textAlign>left</textAlign>
  221.         <font>Chicago</font>
  222.         <textSize>12</textSize>
  223.         <textStyle>plain</textStyle>
  224.         <name>Programs</name>
  225.         <script>on mouseDownif the optionKey is down thenlock screenset visible of card field "Apps" to not visible of card field "Apps"unlock screen with dissolveelseglobal progs,Appsset hilite of target to true-- getProgs is stored in the card scriptif progs is empty then getProgsput HPopUpMenu(progs, 0, bottom of me, left of me) into junkset hilite of target to falseif the result is not empty then put the resultif item 1 of junk is not empty thenget item 1 of junkelseget emptyend ifif it is "Other‚Ķ" thenget "the application that you want"end ifif it is not empty then-- setDirectory is another XCMD I wrotesetDirectory(item 1 of line (item 3 of junk) of Apps)put item 2 of junk into docnameif docname is emptythen open itelse open docname with itend ifend ifset cursor to browseend mouseDown</script>
  226.     </part>
  227.     <part>
  228.         <id>3</id>
  229.         <type>button</type>
  230.         <visible> <true /> </visible>
  231.         <reserved5> 0 </reserved5>
  232.         <reserved4> 0 </reserved4>
  233.         <reserved3> 0 </reserved3>
  234.         <reserved2> 0 </reserved2>
  235.         <reserved1> 0 </reserved1>
  236.         <enabled> <true /> </enabled>
  237.         <rect>
  238.             <left>102</left>
  239.             <top>78</top>
  240.             <right>177</right>
  241.             <bottom>98</bottom>
  242.         </rect>
  243.         <style>roundrect</style>
  244.         <showName> <true /> </showName>
  245.         <highlight> <false /> </highlight>
  246.         <autoHighlight> <false /> </autoHighlight>
  247.         <sharedHighlight> <true /> </sharedHighlight>
  248.         <family>0</family>
  249.         <titleWidth>0</titleWidth>
  250.         <icon>0</icon>
  251.         <textAlign>center</textAlign>
  252.         <font>Chicago</font>
  253.         <textSize>12</textSize>
  254.         <textStyle>plain</textStyle>
  255.         <name>See Script</name>
  256.         <script>on mouseUpedit script of button 1end mouseUp</script>
  257.     </part>
  258.     <part>
  259.         <id>2</id>
  260.         <type>field</type>
  261.         <visible> <false /> </visible>
  262.         <dontWrap> <false /> </dontWrap>
  263.         <dontSearch> <false /> </dontSearch>
  264.         <sharedText> <false /> </sharedText>
  265.         <fixedLineHeight> <true /> </fixedLineHeight>
  266.         <autoTab> <false /> </autoTab>
  267.         <lockText> <false /> </lockText>
  268.         <rect>
  269.             <left>0</left>
  270.             <top>107</top>
  271.             <right>512</right>
  272.             <bottom>342</bottom>
  273.         </rect>
  274.         <style>scrolling</style>
  275.         <autoSelect> <false /> </autoSelect>
  276.         <showLines> <false /> </showLines>
  277.         <wideMargins> <false /> </wideMargins>
  278.         <multipleLines> <false /> </multipleLines>
  279.         <reservedFamily> 0 </reservedFamily>
  280.         <titleWidth>0</titleWidth>
  281.         <icon>0</icon>
  282.         <textAlign>left</textAlign>
  283.         <font>Geneva</font>
  284.         <textSize>10</textSize>
  285.         <textStyle>plain</textStyle>
  286.         <textHeight>13</textHeight>
  287.         <name>Apps</name>
  288.         <script>on closeFieldglobal progsput empty into progsgetProgshide the targetend closeFieldon mouseUphide the targetend mouseUp</script>
  289.     </part>
  290.     <part>
  291.         <id>4</id>
  292.         <type>button</type>
  293.         <visible> <true /> </visible>
  294.         <reserved5> 0 </reserved5>
  295.         <reserved4> 0 </reserved4>
  296.         <reserved3> 0 </reserved3>
  297.         <reserved2> 0 </reserved2>
  298.         <reserved1> 0 </reserved1>
  299.         <enabled> <true /> </enabled>
  300.         <rect>
  301.             <left>312</left>
  302.             <top>82</top>
  303.             <right>331</right>
  304.             <bottom>94</bottom>
  305.         </rect>
  306.         <style>transparent</style>
  307.         <showName> <false /> </showName>
  308.         <highlight> <false /> </highlight>
  309.         <autoHighlight> <false /> </autoHighlight>
  310.         <sharedHighlight> <true /> </sharedHighlight>
  311.         <family>0</family>
  312.         <titleWidth>0</titleWidth>
  313.         <icon>11893</icon>
  314.         <textAlign>center</textAlign>
  315.         <font>Chicago</font>
  316.         <textSize>12</textSize>
  317.         <textStyle>plain</textStyle>
  318.         <name></name>
  319.         <script>on mouseDownsend mouseDown to hittest(the mouseLoc, "btn")end mouseDown</script>
  320.     </part>
  321.     <content>
  322.         <layer>background</layer>
  323.         <id>3</id>
  324.         <text>One of the reasons I wrote this was that I had seen On Cue and had thought it was a good idea.  It did a couple of things differently than I wanted though.  For instance, it did not set your directory to the place where your data file was, like the system does when you open a document from the Finder.  By doing it in Hypercard I could use another XCMD to set the directory anywhere I wanted.  I tried using other popup XFCNs to do what I wanted, but an almost universal problem was that you couldn't choose the main menu item if it had a submenu hanging off of it.  This turns out to be a problem with the way Apple implemented hierarchical menus, but On Cue got around it, so it was possible.  I started writing‚ĶThe button above does better than On Cue except for the fact that it is only accessible from within Hypercard.  Click on the button with the Option key down to see the hidden field that contains the programs, data files, and directory information.  If you copy this, be sure to take the card field also.  I also have an openCard and getProgs handler in the card script to avoid delays when you click on the button.</text>
  325.     </content>
  326.     <content>
  327.         <layer>card</layer>
  328.         <id>2</id>
  329.         <text>::Data:Sounds:,PlaySound;::Data:Paintings:,ViewPaint 1.7;::Terminal:Incoming:,QUED-M 2.01,I want my XMP,12 Days of UNIX,Nightclub Bit,INIT Log;::Data:Words:,MacWrite,Envelope,Mailer,R√©sum√©;::Data:Paintings:,MacPaint 2.0;::Data:Draw:,MacDraw II,Laser Labels,LLNL,my House,The Course of Science,Machine Room Diagram,Fast Choo-choo,F-16,Enterprise,World Map,MFE USA Map,Sears Point;::MPW:Projects:,MPW Shell;ResEdit;::Terminal:,VersaTerm PRO;::Terminal:,Stuffit 1.5.1;::Data:PowerPoint:,PowerPoint 2.0,Template,Memory Management,HFS,Unix,Color Presenting PowerPoint;Klondike 3.3;Seahaven Towers‚Ñ¢;SendPS 1.21;::Terminal:Incoming:,MakeWrite 1.1;::Data:,Lone Ranger 1.9;::Data:Excel Folder:,Microsoft Excel,Macro Stuff,Mac Prices,Phone Groups,Checking 1988;Globe;::Applications:,Other‚Ķ;</text>
  330.     </content>
  331.     <name>Home</name>
  332.     <script>on openCardglobal progsif progs is empty then getProgspass openCardend openCardon getProgs-- This initializes the global variable that contains the menu data-- It is written so that the button can be on a background or-- on a cardglobal progs,Appsput empty into progslock screenpush cardgo to card "Home" -- wherever the card field isput card field "Apps" into Appsrepeat with i = 1 to the number of lines of Appsget line i of Appsif item 2 of it is not empty then delete item 1 of itput it after progsend repeatpop cardunlock screenend getProgs</script>
  333. </card>
  334.  
  335.  
  336. card_5287.xml
  337. <?xml version="1.0" encoding="utf-8" ?>
  338. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  339. <card>
  340.     <id>5287</id>
  341.     <filler1>0</filler1>
  342.     <bitmap>BMAP_5602.pbm</bitmap>
  343.     <cantDelete> <false /> </cantDelete>
  344.     <showPict> <true /> </showPict>
  345.     <dontSearch> <false /> </dontSearch>
  346.     <owner>3736</owner>
  347.     <link rel="stylesheet" type="text/css" href="stylesheet_2245.css" />
  348.     <part>
  349.         <id>11</id>
  350.         <type>button</type>
  351.         <visible> <true /> </visible>
  352.         <reserved5> 0 </reserved5>
  353.         <reserved4> 0 </reserved4>
  354.         <reserved3> 0 </reserved3>
  355.         <reserved2> 0 </reserved2>
  356.         <reserved1> 0 </reserved1>
  357.         <enabled> <true /> </enabled>
  358.         <rect>
  359.             <left>239</left>
  360.             <top>78</top>
  361.             <right>333</right>
  362.             <bottom>98</bottom>
  363.         </rect>
  364.         <style>opaque</style>
  365.         <showName> <true /> </showName>
  366.         <highlight> <false /> </highlight>
  367.         <autoHighlight> <false /> </autoHighlight>
  368.         <sharedHighlight> <true /> </sharedHighlight>
  369.         <family>0</family>
  370.         <titleWidth>0</titleWidth>
  371.         <icon>0</icon>
  372.         <textAlign>left</textAlign>
  373.         <font>Chicago</font>
  374.         <textSize>12</textSize>
  375.         <textStyle>plain</textStyle>
  376.         <name>Example</name>
  377.         <script>on mouseDown-- Note that menu meta-characters work-- ^ for icon-- ‚Ć for small icon-- ! for check mark-- < for style-- ( for disabled items-- See IM I-346 to 349 for more detailsglobal savedItemif savedItem is empty then put 2 into savedItem-- the extra commas are for adding the diamonds to the threes-- null items don't appear in the popup menuif the optionKey is up thenput "Item1,1,2,3," & return & "Item2,;Item3^2,One,Two,Three,;" & ¬¨"Item4^" & NumToChar(270-208) & ",Isn‚Äôt,This,Fun?" & return & "(-;" & ¬¨"Go to,Next Card<I,Last Card,Help,Home^1,(-,Hell<O<I,Jail;" into stuffelse put "Item1,1,2,3," & return & "Item2,;Item3‚Ć2,One,Two,Three,;" & ¬¨"Item4^" & NumToChar(270-208) & ",Isn‚Äôt,This,Fun?" & return & "(-;" & ¬¨"Go to,Next Card<I,Last Card,Help,Home‚Ć1,(-,Hell<O<I,Jail;" into stuff-- the count of items to mark the ones we wantput "!" after item savedItem+1 of stuffput "!" after item savedItem+6 of stuffput HPopUpMenu(stuff, 0, bottom of me, left of me) into junkif item 1 of junk is not empty thenif item 1 of junk is "Go to" and item 2 of junk is not empty thenvisual scroll up to blackvisual scroll upgo to item 2 of junkelseput junkif item 3 of junk is in "13" and item 4 of junk is in "123"then put item 4 of junk into savedItemrepeat for 300if the mouse is down then if the mouse is up then exit repeatend repeathide msgend ifend ifend mouseDown</script>
  378.     </part>
  379.     <part>
  380.         <id>12</id>
  381.         <type>button</type>
  382.         <visible> <true /> </visible>
  383.         <reserved5> 0 </reserved5>
  384.         <reserved4> 0 </reserved4>
  385.         <reserved3> 0 </reserved3>
  386.         <reserved2> 0 </reserved2>
  387.         <reserved1> 0 </reserved1>
  388.         <enabled> <true /> </enabled>
  389.         <rect>
  390.             <left>102</left>
  391.             <top>78</top>
  392.             <right>177</right>
  393.             <bottom>98</bottom>
  394.         </rect>
  395.         <style>roundrect</style>
  396.         <showName> <true /> </showName>
  397.         <highlight> <false /> </highlight>
  398.         <autoHighlight> <false /> </autoHighlight>
  399.         <sharedHighlight> <true /> </sharedHighlight>
  400.         <family>0</family>
  401.         <titleWidth>0</titleWidth>
  402.         <icon>0</icon>
  403.         <textAlign>center</textAlign>
  404.         <font>Chicago</font>
  405.         <textSize>12</textSize>
  406.         <textStyle>plain</textStyle>
  407.         <name>See Script</name>
  408.         <script>on mouseUpedit script of button 1end mouseUp</script>
  409.     </part>
  410.     <part>
  411.         <id>14</id>
  412.         <type>button</type>
  413.         <visible> <true /> </visible>
  414.         <reserved5> 0 </reserved5>
  415.         <reserved4> 0 </reserved4>
  416.         <reserved3> 0 </reserved3>
  417.         <reserved2> 0 </reserved2>
  418.         <reserved1> 0 </reserved1>
  419.         <enabled> <true /> </enabled>
  420.         <rect>
  421.             <left>311</left>
  422.             <top>82</top>
  423.             <right>330</right>
  424.             <bottom>94</bottom>
  425.         </rect>
  426.         <style>transparent</style>
  427.         <showName> <false /> </showName>
  428.         <highlight> <false /> </highlight>
  429.         <autoHighlight> <false /> </autoHighlight>
  430.         <sharedHighlight> <true /> </sharedHighlight>
  431.         <family>0</family>
  432.         <titleWidth>0</titleWidth>
  433.         <icon>11893</icon>
  434.         <textAlign>center</textAlign>
  435.         <font>Chicago</font>
  436.         <textSize>12</textSize>
  437.         <textStyle>plain</textStyle>
  438.         <name></name>
  439.         <script>on mouseDownsend mouseDown to hittest(the mouseLoc, "btn")end mouseDown</script>
  440.     </part>
  441.     <content>
  442.         <layer>background</layer>
  443.         <id>3</id>
  444.         <text>Hierarchical Popup MenusThis example demonstrates how to create a drop down menu with submenus.  This XFCN is limited to one level of submenus which should be enough for most purposes.The important thing to see is the format of the menuitem string.Main1,Sub1,Sub2,Sub3;Main2,Sub1,Sub2,Sub3;Main3;Main4,Sub1,Sub2Please note that the returned values include both menu items chosen and their numbers.  You can use the numbers to index into other arrays or just use the returned values.I use the returned numbers to handle the diamond mark.  See how it remembers what you have chosen.  I tied both menus to the same variable which is probably not how it would be done in real life.</text>
  445.     </content>
  446.     <name></name>
  447.     <script></script>
  448. </card>
  449.  
  450.  
  451. card_7239.xml
  452. <?xml version="1.0" encoding="utf-8" ?>
  453. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  454. <card>
  455.     <id>7239</id>
  456.     <filler1>0</filler1>
  457.     <bitmap>BMAP_7447.pbm</bitmap>
  458.     <cantDelete> <false /> </cantDelete>
  459.     <showPict> <true /> </showPict>
  460.     <dontSearch> <false /> </dontSearch>
  461.     <owner>3736</owner>
  462.     <link rel="stylesheet" type="text/css" href="stylesheet_2245.css" />
  463.     <part>
  464.         <id>1</id>
  465.         <type>button</type>
  466.         <visible> <true /> </visible>
  467.         <reserved5> 0 </reserved5>
  468.         <reserved4> 0 </reserved4>
  469.         <reserved3> 0 </reserved3>
  470.         <reserved2> 0 </reserved2>
  471.         <reserved1> 0 </reserved1>
  472.         <enabled> <true /> </enabled>
  473.         <rect>
  474.             <left>239</left>
  475.             <top>78</top>
  476.             <right>339</right>
  477.             <bottom>98</bottom>
  478.         </rect>
  479.         <style>opaque</style>
  480.         <showName> <true /> </showName>
  481.         <highlight> <false /> </highlight>
  482.         <autoHighlight> <false /> </autoHighlight>
  483.         <sharedHighlight> <true /> </sharedHighlight>
  484.         <family>0</family>
  485.         <titleWidth>0</titleWidth>
  486.         <icon>0</icon>
  487.         <textAlign>left</textAlign>
  488.         <font>Chicago</font>
  489.         <textSize>12</textSize>
  490.         <textStyle>plain</textStyle>
  491.         <name>Application</name>
  492.         <script>on mouseDownif the optionKey is upthen put "Macintosh^1,Application^2,File^3,Folder^4,Disk^5" into choiceselse put "Macintosh‚Ć6,Application‚Ć7,File‚Ć8,Folder‚Ć9,Disk‚Ć:" into choices-- find out what number the button isput 0 into lastItemrepeat with i = 1 to number of items of choicesif item i of choices contains short name of me thenput i into lastItemexit repeatend ifend repeat-- lastItem is negative so that there is no check markget HPopUpMenu(choices, -lastItem, top of me+1, left of me)-- check for errorsif the result is not empty then put the resultif item 1 of it is not empty thenput item 1 of it into lastItem  -- returned item nameset the name of the target to lastItem  -- change button nameend ifend mouseDown</script>
  493.     </part>
  494.     <part>
  495.         <id>2</id>
  496.         <type>button</type>
  497.         <visible> <true /> </visible>
  498.         <reserved5> 0 </reserved5>
  499.         <reserved4> 0 </reserved4>
  500.         <reserved3> 0 </reserved3>
  501.         <reserved2> 0 </reserved2>
  502.         <reserved1> 0 </reserved1>
  503.         <enabled> <true /> </enabled>
  504.         <rect>
  505.             <left>102</left>
  506.             <top>78</top>
  507.             <right>177</right>
  508.             <bottom>98</bottom>
  509.         </rect>
  510.         <style>roundrect</style>
  511.         <showName> <true /> </showName>
  512.         <highlight> <false /> </highlight>
  513.         <autoHighlight> <false /> </autoHighlight>
  514.         <sharedHighlight> <true /> </sharedHighlight>
  515.         <family>0</family>
  516.         <titleWidth>0</titleWidth>
  517.         <icon>0</icon>
  518.         <textAlign>center</textAlign>
  519.         <font>Chicago</font>
  520.         <textSize>12</textSize>
  521.         <textStyle>plain</textStyle>
  522.         <name>See Script</name>
  523.         <script>on mouseUpedit script of button 1end mouseUp</script>
  524.     </part>
  525.     <part>
  526.         <id>3</id>
  527.         <type>button</type>
  528.         <visible> <true /> </visible>
  529.         <reserved5> 0 </reserved5>
  530.         <reserved4> 0 </reserved4>
  531.         <reserved3> 0 </reserved3>
  532.         <reserved2> 0 </reserved2>
  533.         <reserved1> 0 </reserved1>
  534.         <enabled> <true /> </enabled>
  535.         <rect>
  536.             <left>319</left>
  537.             <top>82</top>
  538.             <right>338</right>
  539.             <bottom>94</bottom>
  540.         </rect>
  541.         <style>transparent</style>
  542.         <showName> <false /> </showName>
  543.         <highlight> <false /> </highlight>
  544.         <autoHighlight> <false /> </autoHighlight>
  545.         <sharedHighlight> <true /> </sharedHighlight>
  546.         <family>0</family>
  547.         <titleWidth>0</titleWidth>
  548.         <icon>11893</icon>
  549.         <textAlign>center</textAlign>
  550.         <font>Chicago</font>
  551.         <textSize>12</textSize>
  552.         <textStyle>plain</textStyle>
  553.         <name></name>
  554.         <script>on mouseDownsend mouseDown to hittest(the mouseLoc, "btn")end mouseDown</script>
  555.     </part>
  556.     <part>
  557.         <id>5</id>
  558.         <type>button</type>
  559.         <visible> <true /> </visible>
  560.         <reserved5> 0 </reserved5>
  561.         <reserved4> 0 </reserved4>
  562.         <reserved3> 0 </reserved3>
  563.         <reserved2> 0 </reserved2>
  564.         <reserved1> 0 </reserved1>
  565.         <enabled> <true /> </enabled>
  566.         <rect>
  567.             <left>402</left>
  568.             <top>167</top>
  569.             <right>422</right>
  570.             <bottom>189</bottom>
  571.         </rect>
  572.         <style>transparent</style>
  573.         <showName> <false /> </showName>
  574.         <highlight> <false /> </highlight>
  575.         <autoHighlight> <false /> </autoHighlight>
  576.         <sharedHighlight> <true /> </sharedHighlight>
  577.         <family>0</family>
  578.         <titleWidth>0</titleWidth>
  579.         <icon>19678</icon>
  580.         <textAlign>center</textAlign>
  581.         <font>Chicago</font>
  582.         <textSize>12</textSize>
  583.         <textStyle>plain</textStyle>
  584.         <name></name>
  585.         <script>on mouseUplock screenshow cd fld 1unlock screen with wipe downend mouseUp</script>
  586.     </part>
  587.     <part>
  588.         <id>4</id>
  589.         <type>field</type>
  590.         <visible> <false /> </visible>
  591.         <dontWrap> <false /> </dontWrap>
  592.         <dontSearch> <false /> </dontSearch>
  593.         <sharedText> <false /> </sharedText>
  594.         <fixedLineHeight> <false /> </fixedLineHeight>
  595.         <autoTab> <false /> </autoTab>
  596.         <lockText> <true /> </lockText>
  597.         <rect>
  598.             <left>44</left>
  599.             <top>106</top>
  600.             <right>468</right>
  601.             <bottom>342</bottom>
  602.         </rect>
  603.         <style>opaque</style>
  604.         <autoSelect> <false /> </autoSelect>
  605.         <showLines> <false /> </showLines>
  606.         <wideMargins> <false /> </wideMargins>
  607.         <multipleLines> <false /> </multipleLines>
  608.         <reservedFamily> 0 </reservedFamily>
  609.         <titleWidth>0</titleWidth>
  610.         <icon>0</icon>
  611.         <textAlign>left</textAlign>
  612.         <font>Geneva</font>
  613.         <textSize>10</textSize>
  614.         <textStyle>plain</textStyle>
  615.         <textHeight>13</textHeight>
  616.         <name>Menu Icon Details</name>
  617.         <script>on mouseUplock screenhide meunlock screen with wipe upend mouseUp</script>
  618.     </part>
  619.     <content>
  620.         <layer>background</layer>
  621.         <id>3</id>
  622.         <text>This sample shows how to implement small and color icons in a menu.Use ^ and a character for a cicn (color icon) or ICON (large icon) resource.Use ‚Ć (option-t) for a SICN (small icon) resource (use option on example).These character codes are explained by clicking on this balloon.See IM I-346 to 349 for more details, but you can also use these metacharacters to customize menu items. Use ! to place a check mark next to the item or ( to disable an item. Use <B for bold style, <I for italic style, <S for shadow style & <O for outline style. There isn't any way to include these characters as menu item text.SICNs will not appear on menu items which have submenus. This is because the menu manager uses the same field for the SICN and hierarchical menu ID. It's one or the other. I chose to give the menu precedence.Everything here except for the SICNs is free from the menu manager.</text>
  623.     </content>
  624.     <content>
  625.         <layer>card</layer>
  626.         <id>4</id>
  627.         <text><span class="style1">CONs, cicns, and SICNs use a character code to indicate the icon number. These codes start with the character 1 for ICON or SICN number 257.  There are a limited number of characters above 1 which means that all ICON and SICN resources you want to use in a menu must be numbered 257 through 334 inclusive so that you can specify a character for the code.Note that these characters grow through the ASCII chart, not numerically. (e.g. 2=258, 9=265, :=266, ;=267, <=268, ==269, >=270, ?=271, @=272, A=273, Z=298, [=299, \=300, ]=301, ^=302, _=303, `=304, a=305, z=330, {=331, |=332, }=333, ~=334)Use the expression </span><span class="style4">NumToChar(iconNum-208)</span><span class="style1"> to get the proper character given the number iconNum in the range 257 through 334.You cannot use an icon or SICN of ID 267 because it would be a ; character which would mess up the menu parsing. This is my fault but it would be painful to fix.</span><span class="style3">                              Click on this field to hide it.</span></text>
  628.     </content>
  629.     <name></name>
  630.     <script></script>
  631. </card>
  632.  
  633.  
  634. card_4787.xml
  635. <?xml version="1.0" encoding="utf-8" ?>
  636. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  637. <card>
  638.     <id>4787</id>
  639.     <filler1>0</filler1>
  640.     <bitmap>BMAP_4887.pbm</bitmap>
  641.     <cantDelete> <false /> </cantDelete>
  642.     <showPict> <true /> </showPict>
  643.     <dontSearch> <false /> </dontSearch>
  644.     <owner>3736</owner>
  645.     <link rel="stylesheet" type="text/css" href="stylesheet_2245.css" />
  646.     <part>
  647.         <id>1</id>
  648.         <type>button</type>
  649.         <visible> <true /> </visible>
  650.         <reserved5> 0 </reserved5>
  651.         <reserved4> 0 </reserved4>
  652.         <reserved3> 0 </reserved3>
  653.         <reserved2> 0 </reserved2>
  654.         <reserved1> 0 </reserved1>
  655.         <enabled> <true /> </enabled>
  656.         <rect>
  657.             <left>239</left>
  658.             <top>78</top>
  659.             <right>312</right>
  660.             <bottom>98</bottom>
  661.         </rect>
  662.         <style>opaque</style>
  663.         <showName> <true /> </showName>
  664.         <highlight> <false /> </highlight>
  665.         <autoHighlight> <false /> </autoHighlight>
  666.         <sharedHighlight> <true /> </sharedHighlight>
  667.         <family>0</family>
  668.         <titleWidth>0</titleWidth>
  669.         <icon>0</icon>
  670.         <textAlign>left</textAlign>
  671.         <font>Chicago</font>
  672.         <textSize>12</textSize>
  673.         <textStyle>plain</textStyle>
  674.         <name>Seven</name>
  675.         <script>on mouseDownput "One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten" into choices-- find out what number the button isput 0 into lastItemrepeat with i = 1 to number of items of choicesif item i of choices = short name of me thenput i into lastItemexit repeatend ifend repeat-- lastItem is negative so that there is no check markget HPopUpMenu(choices, -lastItem, top of me+1, left of me)-- check for errorsif the result is not empty then put the resultif item 1 of it is not empty thenput item 1 of it into lastItem  -- returned item nameset the name of the target to lastItem  -- change button nameend ifend mouseDown</script>
  676.     </part>
  677.     <part>
  678.         <id>3</id>
  679.         <type>button</type>
  680.         <visible> <true /> </visible>
  681.         <reserved5> 0 </reserved5>
  682.         <reserved4> 0 </reserved4>
  683.         <reserved3> 0 </reserved3>
  684.         <reserved2> 0 </reserved2>
  685.         <reserved1> 0 </reserved1>
  686.         <enabled> <true /> </enabled>
  687.         <rect>
  688.             <left>102</left>
  689.             <top>78</top>
  690.             <right>177</right>
  691.             <bottom>98</bottom>
  692.         </rect>
  693.         <style>roundrect</style>
  694.         <showName> <true /> </showName>
  695.         <highlight> <false /> </highlight>
  696.         <autoHighlight> <false /> </autoHighlight>
  697.         <sharedHighlight> <true /> </sharedHighlight>
  698.         <family>0</family>
  699.         <titleWidth>0</titleWidth>
  700.         <icon>0</icon>
  701.         <textAlign>center</textAlign>
  702.         <font>Chicago</font>
  703.         <textSize>12</textSize>
  704.         <textStyle>plain</textStyle>
  705.         <name>See Script</name>
  706.         <script>on mouseUpedit script of button 1end mouseUp</script>
  707.     </part>
  708.     <part>
  709.         <id>9</id>
  710.         <type>button</type>
  711.         <visible> <true /> </visible>
  712.         <reserved5> 0 </reserved5>
  713.         <reserved4> 0 </reserved4>
  714.         <reserved3> 0 </reserved3>
  715.         <reserved2> 0 </reserved2>
  716.         <reserved1> 0 </reserved1>
  717.         <enabled> <true /> </enabled>
  718.         <rect>
  719.             <left>291</left>
  720.             <top>82</top>
  721.             <right>310</right>
  722.             <bottom>94</bottom>
  723.         </rect>
  724.         <style>transparent</style>
  725.         <showName> <false /> </showName>
  726.         <highlight> <false /> </highlight>
  727.         <autoHighlight> <false /> </autoHighlight>
  728.         <sharedHighlight> <true /> </sharedHighlight>
  729.         <family>0</family>
  730.         <titleWidth>0</titleWidth>
  731.         <icon>11893</icon>
  732.         <textAlign>center</textAlign>
  733.         <font>Chicago</font>
  734.         <textSize>12</textSize>
  735.         <textStyle>plain</textStyle>
  736.         <name></name>
  737.         <script>on mouseDownsend mouseDown to hittest(the mouseLoc, "btn")end mouseDown</script>
  738.     </part>
  739.     <content>
  740.         <layer>background</layer>
  741.         <id>3</id>
  742.         <text>Regular Popup Menus!In this example we see how the HPopupMenu command can function as a completely normal popup menu.  This is the simplest way to use this XFCN.The menu item string is seperated by commas.  These are all transformed into semicolons when the XFCN sees that there are no heirarchical menus being used.  Semicolons could be used also, but commas give us the ability to say "item N of choices" and use Hypercard‚Äôs limited array capabilities.You may also use returns to seperate items so that you can use the Hypercard syntax "line N of choices".  This is just more flexibility.In Hypercard 2.x you can set the itemDelimiter property to ";" and use the semicolons that the menu manager uses. This spares the XFCN from having to change the commas or returns to semicolons.</text>
  743.     </content>
  744.     <name></name>
  745.     <script></script>
  746. </card>
  747.  
  748.  
  749. card_6129.xml
  750. <?xml version="1.0" encoding="utf-8" ?>
  751. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  752. <card>
  753.     <id>6129</id>
  754.     <filler1>0</filler1>
  755.     <bitmap>BMAP_6654.pbm</bitmap>
  756.     <cantDelete> <false /> </cantDelete>
  757.     <showPict> <true /> </showPict>
  758.     <dontSearch> <false /> </dontSearch>
  759.     <owner>3736</owner>
  760.     <link rel="stylesheet" type="text/css" href="stylesheet_2245.css" />
  761.     <content>
  762.         <layer>background</layer>
  763.         <id>3</id>
  764.         <text>‚Ä¢ The location of the menu takes into account the card window's location so that the menu pops up in the right place even on large screens.‚Ä¢ You can use this as either a regular popup menu or a hierarchical one.‚Ä¢ You may have a very large number of menu items in either the main menu or any of the submenus.  Using a single string avoids Hypercard's limitation of 16 parameters allowed to XCMDs and XFCNs, instead 32,000 characters and 127 hierarchical items per menu are the only limitations.‚Ä¢ You can use commas, returns, or semicolons for regular popup menus.‚Ä¢ You use commas to seperate hierarchical menu items and semicolons or returns to seperate the main menu items.‚Ä¢ Blank items are ignored, allowing extra commas which make indexing into strings with HyperTalk much easier.‚Ä¢ You can make the menu drop down, pop up, and/or have a default checked item through the use of the checkedItem parameter.‚Ä¢ You can use all the standard meta-characters for making special menus. Bold, Italic, Shadow, icons, marked items all work.  See the examples.‚Ä¢ You can select the main menu item even if there is a sub menu on it.‚Ä¢ You can put small icons on menu items with my custom ‚Ć metacharacter.</text>
  765.     </content>
  766.     <name></name>
  767.     <script></script>
  768. </card>
  769.  
  770.  
  771. card_4578.xml
  772. <?xml version="1.0" encoding="utf-8" ?>
  773. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  774. <card>
  775.     <id>4578</id>
  776.     <filler1>0</filler1>
  777.     <bitmap>BMAP_6360.pbm</bitmap>
  778.     <cantDelete> <false /> </cantDelete>
  779.     <showPict> <true /> </showPict>
  780.     <dontSearch> <false /> </dontSearch>
  781.     <owner>3736</owner>
  782.     <link rel="stylesheet" type="text/css" href="stylesheet_2245.css" />
  783.     <content>
  784.         <layer>background</layer>
  785.         <id>3</id>
  786.         <text>get HPopupMenu ( MenuItems, CheckedItem, Top, Left )‚Ä¢ MenuItems is a string of comma, return, or semicolon delimited words.Main1,Sub1,Sub2,Sub3;Main2,Sub1,Sub2,Sub3;Main3;Main4,Sub1,Sub2Commas separate the main menu item and its submenu items while a return or semicolon separates the main menu items.  When there are no submenus can you use all commas, all returns, or all semicolons.‚Ä¢ CheckedItem is the number of the desired default menu item.  If it is zero then the menu drops down, while if it is negative then there is no check mark but the default item is the absolute value of CheckedItem.‚Ä¢ Top, Left is where the menu should appear.  These coordinates are local Hypercard coordinates.The returned result will be:main menu item, sub menu item, main menu number, sub menu number</text>
  787.     </content>
  788.     <name></name>
  789.     <script></script>
  790. </card>
  791.  
  792.  
  793. card_3925.xml
  794. <?xml version="1.0" encoding="utf-8" ?>
  795. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  796. <card>
  797.     <id>3925</id>
  798.     <filler1>0</filler1>
  799.     <bitmap>BMAP_2507.pbm</bitmap>
  800.     <cantDelete> <false /> </cantDelete>
  801.     <showPict> <true /> </showPict>
  802.     <dontSearch> <false /> </dontSearch>
  803.     <owner>3736</owner>
  804.     <link rel="stylesheet" type="text/css" href="stylesheet_2245.css" />
  805.     <part>
  806.         <id>6</id>
  807.         <type>button</type>
  808.         <visible> <true /> </visible>
  809.         <reserved5> 0 </reserved5>
  810.         <reserved4> 0 </reserved4>
  811.         <reserved3> 0 </reserved3>
  812.         <reserved2> 0 </reserved2>
  813.         <reserved1> 0 </reserved1>
  814.         <enabled> <true /> </enabled>
  815.         <rect>
  816.             <left>241</left>
  817.             <top>224</top>
  818.             <right>382</right>
  819.             <bottom>258</bottom>
  820.         </rect>
  821.         <style>transparent</style>
  822.         <showName> <false /> </showName>
  823.         <highlight> <false /> </highlight>
  824.         <autoHighlight> <false /> </autoHighlight>
  825.         <sharedHighlight> <true /> </sharedHighlight>
  826.         <family>0</family>
  827.         <titleWidth>0</titleWidth>
  828.         <icon>0</icon>
  829.         <textAlign>center</textAlign>
  830.         <font>Chicago</font>
  831.         <textSize>12</textSize>
  832.         <textStyle>plain</textStyle>
  833.         <name></name>
  834.         <script>on mouseUplock screenshow card field "Version"unlock screen with dissolveend mouseUp</script>
  835.     </part>
  836.     <part>
  837.         <id>8</id>
  838.         <type>button</type>
  839.         <visible> <true /> </visible>
  840.         <reserved5> 0 </reserved5>
  841.         <reserved4> 0 </reserved4>
  842.         <reserved3> 0 </reserved3>
  843.         <reserved2> 0 </reserved2>
  844.         <reserved1> 0 </reserved1>
  845.         <enabled> <true /> </enabled>
  846.         <rect>
  847.             <left>0</left>
  848.             <top>264</top>
  849.             <right>46</right>
  850.             <bottom>342</bottom>
  851.         </rect>
  852.         <style>transparent</style>
  853.         <showName> <false /> </showName>
  854.         <highlight> <true /> </highlight>
  855.         <autoHighlight> <false /> </autoHighlight>
  856.         <sharedHighlight> <true /> </sharedHighlight>
  857.         <family>0</family>
  858.         <titleWidth>0</titleWidth>
  859.         <icon>11045</icon>
  860.         <textAlign>center</textAlign>
  861.         <font>Chicago</font>
  862.         <textSize>12</textSize>
  863.         <textStyle>plain</textStyle>
  864.         <name>Home</name>
  865.         <script>on mouseUpvisual scroll upgo homeend mouseUp</script>
  866.     </part>
  867.     <part>
  868.         <id>7</id>
  869.         <type>field</type>
  870.         <visible> <false /> </visible>
  871.         <dontWrap> <false /> </dontWrap>
  872.         <dontSearch> <false /> </dontSearch>
  873.         <sharedText> <false /> </sharedText>
  874.         <fixedLineHeight> <true /> </fixedLineHeight>
  875.         <autoTab> <false /> </autoTab>
  876.         <lockText> <true /> </lockText>
  877.         <rect>
  878.             <left>211</left>
  879.             <top>206</top>
  880.             <right>432</right>
  881.             <bottom>273</bottom>
  882.         </rect>
  883.         <style>opaque</style>
  884.         <autoSelect> <false /> </autoSelect>
  885.         <showLines> <false /> </showLines>
  886.         <wideMargins> <true /> </wideMargins>
  887.         <multipleLines> <false /> </multipleLines>
  888.         <reservedFamily> 0 </reservedFamily>
  889.         <titleWidth>0</titleWidth>
  890.         <icon>0</icon>
  891.         <textAlign>center</textAlign>
  892.         <font>Geneva</font>
  893.         <textSize>9</textSize>
  894.         <textStyle>plain</textStyle>
  895.         <textHeight>12</textHeight>
  896.         <name>Version</name>
  897.         <script>on mouseUplock screenhide meunlock screen with dissolveend mouseUp</script>
  898.     </part>
  899.     <content>
  900.         <layer>background</layer>
  901.         <id>3</id>
  902.         <text>This is a version of a fairly common XFCN called HPopupMenu which, surprisingly enough, creates a hierarchical popup menu anywhere on a card.  This version is much more robust than other versions I have seen and incorporates some features that I have not seen in other implementations, which is why I wrote it.Feel free to send questions, comments, praise and money to me:Jon Pugh(510) 373-7872(408) 862-7094jpugh@apple.comjonpugh@applelink.apple.comThis stack, the source code, and the XCMDs and XFCNs contained herein are copyright 1989, 1990, 1991 by Jon Pugh.  They may be used freely as long as no money is charged for them or any product that contains them.</text>
  903.     </content>
  904.     <content>
  905.         <layer>card</layer>
  906.         <id>7</id>
  907.         <text>This change consisted of a possible bug fix that no one reported (an unlocked handle) and the addition of small icon support. I also added the down arrow to my popup menus so that they look like proper popups.</text>
  908.     </content>
  909.     <name></name>
  910.     <script>on closeCardif visible of card field "Version" then hide card field "Version"pass closeCardend closeCard</script>
  911. </card>
  912.  
  913.  
  914.